package com.wangwen.wechatmp.base;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;

import java.io.Serializable;
import java.util.List;

public interface BaseService<T,PK extends Serializable> {

    T findById(PK id);

    List<T> findAll();

    T save(T entity);

    Iterable<T> save(Iterable<T> entities);

    void remove(T entity);

    void remove(Iterable<T> entities);

    void remove(PK id);

    Page<T> findPage(Pageable page, Specification<T> sepc);

}

